/**
 * <p>Title: CellImpl.java</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2009</p>
 * <p>Company: xunjie</p>
 * @author shenhao
 * @date 2010-3-8
 * @version 1.0
 */
package cn.haona.game.simb.object;

import java.io.Serializable;

/**
 * <p>
 * Title: CellImpl
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Company: xunjie
 * </p>
 * 
 * @author shenhao
 * @date 2010-3-8
 */
public abstract class CellImpl implements Cell,Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3885672010950695974L;
	// 持久化对象
	protected Persistence pO;

	public Persistence getPO() {
		return pO;
	}

	/**
	 * @param id
	 * 
	 * 
	 */
	public CellImpl() {
	}

	/*
	 * (non-Javadoc)根据ID从持久化数据中更新我
	 * 
	 * @see cn.haona.game.simb.Cell#updateByPersis(long)
	 */
	public boolean updateByPersis(long id) {
		if (getPO() == null) {
			initPO();
			pO.setId(id);
		}
		pO.updateMe();
		return true;
	}

	/*
	 * (non-Javadoc) <p>Title: destroyMe</p> <p>Description: </p>
	 * 
	 * @see cn.haona.game.simb.Cell#destroyMe()
	 */

	public void destroyMe() {
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc) <p>Title: getID</p> <p>Description: </p>
	 * 
	 * @return
	 * 
	 * @see cn.haona.game.simb.Cell#getID()
	 */

	/*
	 * (non-Javadoc) <p>Title: initMe</p> <p>Description: </p>
	 * 
	 * @see cn.haona.game.simb.Cell#initMe()
	 */

	public void initMe(long id) {
		updateByPersis(id);
	}

	/*
	 * (non-Javadoc) <p>Title: logic</p> <p>Description: </p>
	 * 
	 * @see cn.haona.game.simb.Cell#logic()
	 */

	public void logic() {
		// TODO Auto-generated method stub
	}

}
